package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type AppConfig struct {
	Mysql struct {
		Host     string
		Port     int
		User     string
		Password string
	}

	Redis struct {
		Host     string
		Port     int
		Password string
	}
}

var AppName AppConfig

func Init() {
	viper.SetConfigFile("../appconfig/config.yaml")
	if err := viper.ReadInConfig(); err != nil {
		panic(err)
		return
	}
	viper.Unmarshal(&AppName)
	fmt.Println(AppName)
}
